package org.linlinjava.litemall.admin.shiro;

import org.apache.shiro.SecurityUtils;

public class AuthUtils {
    public static LitemallAdminExt getAdmin() {
        return (LitemallAdminExt) SecurityUtils.getSubject().getPrincipal();
    }

    public static Boolean isStore() {
        LitemallAdminExt litemallAdminExt = (LitemallAdminExt) SecurityUtils.getSubject().getPrincipal();
        return litemallAdminExt.getStoreId()!=null?true:false;
    }

    public static Integer getStoreId() {
        LitemallAdminExt litemallAdminExt = (LitemallAdminExt) SecurityUtils.getSubject().getPrincipal();
        return litemallAdminExt.getStoreId();
    }
}
